

package com.hazelcast.spi.impl.operationservice;

/**
 * An factory for creating partition specific tasks.
 * <p>
 * A task can be:
 * <ol>
 * <li>Operation</li>
 * <li>Runnable</li>
 * </ol>
 * <p>
 * See {@link OperationService#executeOnPartitions} for more details.
 */
public interface PartitionTaskFactory<T> {

    /**
     * Creates the task.
     *
     * @param partitionId the partitionId of the
     *                    partition this task is going to run on
     * @return the created task. The returned task should not be null.
     */
    T create(int partitionId);
}
